#! /usr/bin/python
# Print the fibonacci sequence up until a given bound


def fibonacci(a):
  num = 0
  numPrev=1
  numPrev2=0
  while num <= a:
    print num
    numPrev2 = numPrev
    numPrev = num
    num = numPrev + numPrev2

def fibonacci_number(i):
  sequence= [0]
  a = 0
  num = 0
  numPrev=1
  numPrev2=0
  for a in range(0,i+1):
    sequence.append(num)
    numPrev2 = numPrev
    numPrev = num
    num = numPrev + numPrev2
  return sequence[i+1] 

def main():
  fibonacci(4)
  fibonacci(13)
  
  for i in range(10):
    print fibonacci_number(i)

if __name__=='__main__':
  main()
